const tag = (temp, ...args) => (context) => {
  console.log('++++++++++ tag +++++++++++')
  console.log(temp)
  console.log(args)
  console.log(context)
  console.log('---------- tag ----------')

  return temp.reduce((rslt, str, index) => {
    rslt = rslt + str
    if (!!args[index]) {
      rslt = rslt + (
        ('function' === typeof args[index]) ? args[index](context) : args[index]
      );
    }
    return rslt
  }, '')
}

const gen = tag`hello ${(props) => props.x} world`
console.log('result: ', gen({x: 'abc'}))
